Improve coment re:setCodecForCStrings.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 26 Aug 2013 16:21:36 +0000 (16:21 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 26 Aug 2013 16:21:36 +0000 (16:21 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4575 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/main.cc

index d619173239bee045ca8801929e8a067469b52cc8..e136d39b0b3df1e5a65d8c4f6bbf3dce3a6ec4da 100644 (file)
@@ -240,9 +240,11 @@ main(int argc, char* argv[])
   arg_stack_t* arg_stack = NULL;
 
 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
-  //Qt requires that source files are stored in utf-8 in Qt5 (setCodecForCStrings removed)
-  //Allow compile for newer Qt, even if testo may fail
-  //This should be addressed in the Qt4 builds too
+  // Qt 5.0 uses QString::fromUtf8 to convert from character pointers 
+  // and QBytreArrays to QStrings while previous version of Qt used 
+  // QString::fromAscii.  QString::fromAscii used the codec set
+  // by QTextCode::setCodecForCStrings.
+  // This makes the converstion consistent between Qt4 and Qt5.
   QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 #endif